home *** CD-ROM | disk | FTP | other *** search
/ PC User 2003 May / Disc 2 / PCU0503CD2.iso / Crystal / Samples / CPP / 32bit / Mycall / MYCALL.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-18  |  3.7 KB  |  142 lines

  1. // MYCALL.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "MYCALL.h"
  6. #include "MainFrm.h"
  7. #include "MYCALLDc.h"
  8. #include "MainView.h"
  9.  
  10. #ifdef _DEBUG
  11. #define new DEBUG_NEW
  12. #undef THIS_FILE
  13. static char THIS_FILE[] = __FILE__;
  14. #endif
  15.  
  16. /////////////////////////////////////////////////////////////////////////////
  17. // CMYCALLApp
  18.  
  19. BEGIN_MESSAGE_MAP(CMYCALLApp, CWinApp)
  20.     //{{AFX_MSG_MAP(CMYCALLApp)
  21.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  22.         // NOTE - the ClassWizard will add and remove mapping macros here.
  23.         //    DO NOT EDIT what you see in these blocks of generated code!
  24.     //}}AFX_MSG_MAP
  25.     // Standard file based document commands
  26.     ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  27.     ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  28.     // Standard print setup command
  29.     ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
  30. END_MESSAGE_MAP()
  31.  
  32. /////////////////////////////////////////////////////////////////////////////
  33. // CMYCALLApp construction
  34.  
  35. CMYCALLApp::CMYCALLApp()
  36. {
  37.     // TODO: add construction code here,
  38.     // Place all significant initialization in InitInstance
  39. }
  40.  
  41. /////////////////////////////////////////////////////////////////////////////
  42. // The one and only CMYCALLApp object
  43.  
  44. CMYCALLApp theApp;
  45.  
  46. /////////////////////////////////////////////////////////////////////////////
  47. // CMYCALLApp initialization
  48.  
  49. BOOL CMYCALLApp::InitInstance()
  50. {
  51.     // Standard initialization
  52.     // If you are not using these features and wish to reduce the size
  53.     //  of your final executable, you should remove from the following
  54.     //  the specific initialization routines you do not need.
  55.  
  56. #ifdef _AFXDLL
  57.     Enable3dControls();            // Call this when using MFC in a shared DLL
  58. #else
  59.     Enable3dControlsStatic();    // Call this when linking to MFC statically
  60. #endif
  61.  
  62.     LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  63.  
  64.     // Register the application's document templates.  Document templates
  65.     //  serve as the connection between documents, frame windows and views.
  66.  
  67.     CSingleDocTemplate* pDocTemplate;
  68.     pDocTemplate = new CSingleDocTemplate(
  69.         IDR_MAINFRAME,
  70.         RUNTIME_CLASS(CMYCALLDoc),
  71.         RUNTIME_CLASS(CMainFrame),       // main SDI frame window
  72.         RUNTIME_CLASS(MainView));
  73.     AddDocTemplate(pDocTemplate);
  74.  
  75.     // Parse command line for standard shell commands, DDE, file open
  76.     CCommandLineInfo cmdInfo;
  77.  
  78.     ParseCommandLine(cmdInfo);
  79.  
  80.     // Dispatch commands specified on the command line
  81.     if (!ProcessShellCommand(cmdInfo))
  82.         return FALSE;
  83.  
  84.     return TRUE;
  85. }
  86.  
  87. /////////////////////////////////////////////////////////////////////////////
  88. // CAboutDlg dialog used for App About
  89.  
  90. class CAboutDlg : public CDialog
  91. {
  92. public:
  93.     CAboutDlg();
  94.  
  95. // Dialog Data
  96.     //{{AFX_DATA(CAboutDlg)
  97.     enum { IDD = IDD_ABOUTBOX };
  98.     //}}AFX_DATA
  99.  
  100.     // ClassWizard generated virtual function overrides
  101.     //{{AFX_VIRTUAL(CAboutDlg)
  102.     protected:
  103.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  104.     //}}AFX_VIRTUAL
  105.  
  106. // Implementation
  107. protected:
  108.     //{{AFX_MSG(CAboutDlg)
  109.         // No message handlers
  110.     //}}AFX_MSG
  111.     DECLARE_MESSAGE_MAP()
  112. };
  113.  
  114. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  115. {
  116.     //{{AFX_DATA_INIT(CAboutDlg)
  117.     //}}AFX_DATA_INIT
  118. }
  119.  
  120. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  121. {
  122.     CDialog::DoDataExchange(pDX);
  123.     //{{AFX_DATA_MAP(CAboutDlg)
  124.     //}}AFX_DATA_MAP
  125. }
  126.  
  127. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  128.     //{{AFX_MSG_MAP(CAboutDlg)
  129.         // No message handlers
  130.     //}}AFX_MSG_MAP
  131. END_MESSAGE_MAP()
  132.  
  133. // App command to run the dialog
  134. void CMYCALLApp::OnAppAbout()
  135. {
  136.     CAboutDlg aboutDlg;
  137.     aboutDlg.DoModal();
  138. }
  139.  
  140. /////////////////////////////////////////////////////////////////////////////
  141. // CMYCALLApp commands
  142.